package org.credo.emayMMS;

import java.io.IOException;
import java.util.UUID;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class IOServlet extends HttpServlet{

	private static final long serialVersionUID = -2756526166660542652L;

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		System.out.println("进入Servlet!");
		String phoneNumber=req.getParameter("phoneNumber");
		String message=req.getParameter("message");
		IOTest io=new IOTest();
		io.sendSMS(1, message);
		return;
	}
	
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		this.doGet(req, resp);
	}
	
	public static void main(String[] args) {
		//获取系统的临时文件夹Path
		String filePath=System.getProperty("java.io.tmpdir");
		System.out.println(filePath);
		//生成一个UUID.
		String fileName=UUID.randomUUID().toString();
		System.out.println("fileName:"+fileName);
		
		String txtPath=filePath+fileName+".txt";
		String smilPath=filePath+fileName+".smil";
		String zipPath=filePath+fileName+".zip";
		
		System.out.println(txtPath);
		System.out.println(smilPath);
		System.out.println(zipPath);
		
	}
}
